import Vue from "vue";
import Router from "vue-router";
import index from "@/views/index.vue";

Vue.use(Router);
export const demoRouter = {
  path: "/demo",
  name: "demo",
  meta: { title: "测试" },
  component: () => import("@/views/components/card.vue"),
  children: [
    {
      path: "/demo/list",
      meta: { title: "demo测试" },
      component: () => import("@/views/demo/curd/list.vue")
    }
  ]
};

export const allRouters = [demoRouter];
const baseRoutes = [
  {
    path: "/",
    name: "index",
    redirect: "/demo"
  },
  {
    path: "/home",
    name: "home",
    component: index
  }
];

export default new Router({
  routes: baseRoutes.concat(demoRouter)
});
